home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Hungarian notation
- Date: Sat, 20 Jan 1996 13:51:36 GMT
- Organization: Netcom
- Message-ID: <3100f0ac.134780672@nntp.ix.netcom.com>
- References: <4dhkae$an9@blackice.winternet.com> <821890870snz@genesis.demon.co.uk> <30fd5306.3171520@nntp.ix.netcom.com> <822101689snz@genesis.demon.co.uk>
- NNTP-Posting-Host: ix-dc7-13.ix.netcom.com
- X-NETCOM-Date: Sat Jan 20 5:51:21 AM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
-
- > In article <30fd5306.3171520@nntp.ix.netcom.com>
- > miker3@ix.netcom.com "Mike Rubenstein" writes:
- >
- > >I'm sure Lawrence is aware of this, but it's worth noting that while
- > >casting to long double is almost certainly safe in that it will not
- > >cause damage, it may not print out anything useful. It's possible
- > >that time_t is an integral type that cannot be represented exactly as
- > >a long double and the least significant bits, that are lost in the
- > >conversion, may be significant.
- >
- > As Dan has pointed out long double is the only type you can use and be
- > sure that it doesn't result in undefined behaviour. While loss of
- > precision is possible the chances of this happening in practice are small.
- > Of course you have to answer what the use is for printing out a time_t
- > value. Most likely that is for debugging or it assumes a particular
- > format. At any rate the result is inherently system specific.
-
- This is true only if you accept that any integral type can be
- converted to long double. I find Dan's argument unconvincing.
-
- Of course, as I pointed out, it would be a pretty wierd implementation
- in which a value for an integral type cannot be converted to long
- double, but I don't see where the standard forbids such an
- implementation.
-
- Michael M Rubenstein
-